interface ASTNodeInterface {
  start: number;
  end: number;
}

interface ASTBlockNode extends ASTNodeInterface {
  // eslint-disable-next-line no-use-before-define
  content: ASTNode[];
  type: 'block' | 'blockdirective' | 'directive' | 'main';
}

interface ASTContentNode extends ASTNodeInterface {
  type: 'inlinecomment' | 'name' | 'parameter';
  content: string;
}

interface ASTCommentNode extends ASTNodeInterface {
  type: 'comment';
  content: string;
}

interface ASTEmptyNode extends ASTNodeInterface {
  type: 'hardbreak' | 'linebreak' | 'semicolon';
  content: undefined;
}

type ASTNode = ASTBlockNode | ASTCommentNode | ASTContentNode | ASTEmptyNode;

const locStart = (node: ASTNode) => {
  return node.start;
};

const locEnd = (node: ASTNode) => {
  return node.end;
};

export { locEnd, locStart };
